<html>
    <head>
        <title>JSP Form Demo</title>
        <style type="text/css">
            label{ margin-right:20px;}
            input{ margin-top:5px;}
        </style>
    </head>
    <body>
        <%
            String val = request.getParameter("isSubmitted");
            int isSubmitted = 0;
            if (val != null) {
                isSubmitted = Integer.parseInt(val);
                if (isSubmitted == 1) {
                    String UserId = request.getParameter("UserId");
                    String Password = request.getParameter("Password");
                    
                }
            }
        %>
        <form action="departmnetspage.html" method="post">
            <fieldset>
                <legend>User Information</legend>
                <label for="UserId">UserId</label>
                <input type="string" name="UserId" /> <br/>
                <label for="Password">Password</label>
                <input type="String" name="Password" /> <br/>
                <input type="hidden" name="isSubmitted" />
                <input type="submit" value="submit">
            </fieldset>
        </form>
        
    </body>
</html>